473,419 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Hover Menu

To all,

I'm trying to do exactly what is instructed in the following weblink
http://ajax.asp.net/ajaxtoolkit/Hove...HoverMenu.aspx. However, I can't
get the selected item in my griview row to appear in my text box. Can
someone advise?

Here is my samples:

Code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then

_ds = DataAccess.All_Advertisements()
ViewState.Add("_ds", _ds)
_dv = _ds.Tables(0).DefaultView

gv_advertisements.DataSource = _dv
gv_advertisements.DataBind()

End If
End Sub
Protected Sub gv_advertisements_Sorting(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewSortEventArgs) Handles
gv_advertisements.Sorting

_ds = CType(ViewState.Item("_ds"), Data.DataSet)
_dv = _ds.Tables(0).DefaultView
_dv.Sort = e.SortExpression

gv_advertisements.DataSource = _dv
gv_advertisements.DataBind()

End Sub

Protected Sub gv_advertisements_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
gv_advertisements.SelectedIndexChanged
TextBox1.Text = gv_advertisements.SelectedRow.Cells(4).Text()

End Sub
Protected Sub btn_Search_Advertisement_by_Date_Click(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
btn_Search_Advertisement_by_Date.Click

_s_date = tb_start_date.Text
_e_date = tb_end_date.Text

_ds = DataAccess.All_Advertisements(_s_date, _e_date)
ViewState.Add("_ds", _ds)
_dv = _ds.Tables(0).DefaultView

gv_advertisements.DataSource = _dv
gv_advertisements.DataBind()

End Sub

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
TextBox1.Text = gv_advertisements.SelectedRow.Cells(4).Text() '"Hello"
End Sub
End Class

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">

</script>

<link href="Styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server" >

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:Panel ID="pnl_Advertisements" runat="server" Height="160px"
Style="z-index: 100;
left: 296px; position: absolute; top: 24px" Width="464px">
<asp:UpdatePanel ID="upp_Advertisements" runat="server">
<ContentTemplate>
<asp:Panel ID="pnl_Scroll_Advertisements" runat="server"
Height="160px" Width="456px" ScrollBars="Vertical">
<asp:GridView ID="gv_advertisements" runat="server"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
ForeColor="#333333" GridLines="None"
Height="152px" PageSize="5" Width="784px"
AutoGenerateSelectButton="True">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:BoundField DataField="Advertisement Name"
HeaderText="Advertisement Name" SortExpression="Advertisement Name">
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Present Date"
HeaderText="Present Date" SortExpression="Present Date">
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Expiration Date"
HeaderText="Expiration Date" SortExpression="Expiration Date">
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Advertisement ID"
HeaderText="Advertisement ID">
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True"
ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</asp:Panel>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:HoverMenuExtender ID="HoverMenuExtender1"
runat="server" TargetControlID="gv_advertisements" PopupControlID="Panel1"
HoverCssClass="popupHover" PopupPosition="Top"
OffsetX="-10" OffsetY="-10" PopDelay="50">
</cc1:HoverMenuExtender>
<asp:Panel ID="Panel1" runat="server" Height="50px"
Width="125px">
<asp:LinkButton ID="LinkButton1" runat="server"
CommandName="edit" Text="edit"
OnClick="LinkButton1_Click"></asp:LinkButton></asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="btn_Search_Advertisement_by_Date" />
</Triggers>

</asp:UpdatePanel>
<asp:Button ID="btn_Search_Advertisement_by_Date" runat="server"
Text="Search Advertisements by Date" />
</asp:Panel>
<br />
<cc1:Accordion ID="acc_Search_Panes" runat="server"
SelectedIndex="0" SuppressHeaderPostbacks="true" Width="224px"
Height="248px">

<Panes>
<cc1:AccordionPane runat="server">
<Header>"Test1" </Header>
<Content"Testing This First Content" </Content>
</cc1:AccordionPane>
</Panes>

<Panes>
<cc1:AccordionPane runat="server">
<Header>Dates</Header>
<Content>
<hr />
<asp:TextBox ID="tb_start_date" runat="server" style="z-index:
104;" Width="152px"></asp:TextBox>
<asp:Image ID="img_start_date" runat="server" Height="16px"
Style="z-index: 107;" Width="56px" />
<asp:TextBox ID="tb_end_date" runat="server" Style="z-index:
101;" Width="152px"></asp:TextBox>
<asp:Image ID="img_end_date" runat="server" Height="16px"
Style="z-index: 103;" Width="56px" />
<cc1:CalendarExtender ID="cle_start_date" runat="server"
TargetControlID="tb_start_date" PopupButtonID="img_start_date">
</cc1:CalendarExtender>
<cc1:CalendarExtender ID="cle_end_date" runat="server"
TargetControlID="tb_end_date" PopupButtonID="img_end_date">
</cc1:CalendarExtender>
<hr />
</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
<br />

<asp:Panel ID="pnl_Charts" runat="server" Height="256px"
Style="z-index: 101; left: 296px;
position: absolute; top: 320px" Width="808px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<hr style="height: 1px" />
<asp:Label ID="lbl_Test2" runat="server" Height="24px"
Text="Label" Width="184px"></asp:Label>
<br />
<br />
<br />
<DCWC:Chart ID="cht_Advertisement" runat="server"
Palette="Pastel" Width="800px">
<Legends>
<DCWC:Legend Name="Default">
<Position Height="8.026756" Width="28.0936451"
X="68.90636" Y="3" />
</DCWC:Legend>
</Legends>
<Series>
<DCWC:Series Color="Red" Name="Failed"
BorderColor="64, 64, 64" ShadowOffset="1" ChartType="StackedColumn">
</DCWC:Series>
<DCWC:Series Color="Yellow" Name="Pending"
BorderColor="64, 64, 64" ShadowOffset="1" ChartType="StackedColumn">
</DCWC:Series>
<DCWC:Series BorderColor="64, 64, 64" Color="Lime"
Font="Mistral, 8.25pt"
Name="Succeeded" ShadowOffset="1"
ChartType="StackedColumn">
</DCWC:Series>
</Series>
<ChartAreas>
<DCWC:ChartArea Name="Default">
<AxisX>
<LabelStyle Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorTickMark Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorGrid Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
</AxisX>
<Area3DStyle Enable3D="True" Light="Realistic" />
<InnerPlotPosition Height="74.08244"
Width="75.69049" X="20.13664" Y="3.35106" />
<Position Height="94" Width="62.9063568" X="3"
Y="3" />
<AxisY>
<LabelStyle Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorTickMark Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorGrid Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
</AxisY>
<AxisX2>
<LabelStyle Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorTickMark Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorGrid Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
</AxisX2>
<AxisY2>
<LabelStyle Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorTickMark Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
<MajorGrid Interval="Auto"
IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
</AxisY2>
</DCWC:ChartArea>
</ChartAreas>
<Titles>
<DCWC:Title Name="ClickedElement">
<Position Width="94" X="3" Y="3" />
</DCWC:Title>
</Titles>
</DCWC:Chart>
<hr style="height: 1px" />
</ContentTemplate>
<%--<triggers>
<asp:AsyncPostBackTrigger ControlID = "button1"
eventname="click" />
</triggers>--%>
</asp:UpdatePanel>
</asp:Panel>

Styles.css:
..sortheaderrowstyle {
background-color: #006699;
text-align: left;
font-weight: bold;
color:White;
}

..popupHover {
background-color:#F5F7F8;
}

..popupMenu {
background-color:#AAFFFF;
}

Mar 28 '07 #1
0 4767

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dan | last post by:
When a user clicks on a link in my menu, I want the background color of the link that comes up in the hover to remain on the destination page. My menu looks like this: <div id="adminmenu"> <a...
5
by: toylet | last post by:
Attached is some css codes for a website. It has 3 parts: top-bar, side-bar (on the left) and main-body. The top-bar has a mouseover menu called top-menu implemented via ul:hover. When the mouse...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
13
by: windandwaves | last post by:
Hi Folk Just a bit of help here for newbies who want their menus to look nicer. I am sure that many of you make menus like this <ul id="menu"> <li><a href="page1.html">option 1</a></li>...
1
by: Richard | last post by:
A menu page has a set of A tages in a UL The menu (in IE) will only get the hover visualization if the mouse rolls over underlined text. I want it to happen if the rollover occurs anywhere in...
2
by: andrewtayloruk | last post by:
Hi, i'm pretty new to CSS and html so please go easy on me. I'm trying to make a menu, the idea is that when you hover over the images in the menu they glow. To do this i have set up the...
4
by: bne | last post by:
Hi, My brain's a bit fried on this one. I'm using the li:hover method to display sub menus at http://dev.hyl.co.uk/guide4life/. All works swimmingly in FF, however IE7 loses the hover (and so...
3
by: noize | last post by:
I have found other bugs related to using hover is CSS with IE, but I cannot find a fix for my issue. I have checked it in both IE 6 & 7 with the same results. I have built a drop-down menu using...
4
by: Sigilaea | last post by:
My previous post got squashed because m post is too long. Sorry for that: I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks...
8
by: Meri | last post by:
Hello Everybody on the internet seems to think this is a problem with IE but for me it works fine with IE, but the submenus do not appear with Firefox andOpera. The html is a simple list with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.